<% if @orders.present? then %>
<div >
	<h2 class="category">Order History</h2>
	
	<table>
	<tr>
		<th>Order Number</th>
        <th>Status</th>
		<th>Date</th>
		<th>Total Price</th>
	</tr>
	<% @orders.each do |order| %>
		<tr class="<%= cycle('odd', 'even') %>">
			<td><%= link_to order.order_number, order_history_details_path(order.order_number) %></td>
            <td><%= order.order_status %></td>
			<td><%= order.created_at.strftime("%m/%d/%Y") if order.created_at.present? %></td>
		    <td><%= order.grand_total if order.grand_total.present? %></td>
		</tr>
	<% end %>
	</table>
</div>
<% end %>

<%= link_to "Back", profiles_path %> 